home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / nelson / fhandle.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-12  |  938 b   |  35 lines

  1. /* ----------------------------------------------------
  2.  *  Listing 7
  3.  *
  4.  *  fhandle.h
  5.  *  Adds file-specific capability to IoctlHandle
  6.  * ------------------------------------------------- */
  7.  
  8. #ifndef __FHANDLE_H
  9. #define __FHANDLE_H
  10.  
  11. #include "iohandle.h"
  12.  
  13. class fileHandle : public IoctlHandle  {
  14. protected:
  15.     fileHandle( const char *path )
  16.                 : IoctlHandle( path )  { }
  17.     fileHandle( int handle )
  18.                 : IoctlHandle( handle )  { }
  19. public:
  20.     static fileHandle *Init(const char *path );
  21.     static fileHandle *Init(int handle );
  22.     ~fileHandle() { }
  23.  
  24.     //Return 0-based drive# for a file handle....
  25.     int driveNumber(void )
  26.         {   return (drive_number & _info); }
  27.  
  28.     int fileEof(void)    //returns !0 if at eof
  29.         {   return !inputStatus();  }
  30. };  //.... end class fileHandle
  31.  
  32. #endif  // __FHANDLE_H
  33.  
  34. /* ----- End of File ------------------------------- */
  35.